#set(title='我的二手书单',menu='secondtrade',statusMap={'0':'待审核','1':'交易中','2':'待发货','3':'待买家确认收货','4':'交易完成','5':'交易关闭','6':'审核拒绝'})
#@user_layout()
#define user_main()
	 <h1 class="page-header">#(title)</h1>
     <div class="table-responsive">
            <table class="table table-striped ">
            <caption><span class="text-warning"><h3>我发起的二手书</h3></span></caption>
              <thead>
                <tr>
                  <th>序号</th>
                  <th>图书</th>
                  <th>数量</th>
                  <th>原价</th>
                  <th>二手价</th>
                  <th>状态</th>
                  <th>操作</th>
                </tr>
              </thead>
              <tbody>
               #for(x : page.getList())
	             	<tr>
	                  <td>#(for.index+1)</td>
	                  <td>
	                  	<a href="#(ctx)/book/detail/#(x.bookId)"><img src="#(uploadPah)#(x.book.bookImg)" alt="book image" width="70px"></a>
	              				<a href="#(ctx)/book/detail/#(x.bookId)">#(x.book.name)</a>
	                  </td>
	                 <td>#(x.num)</td>
	                  <td>#(x.total)</td>
	                  <td>#(x.soldTotal)</td>
	                  <td>#(statusMap[x.status+''])</td>
	                  <td>
	                  	<a type="button" class="btn btn-info" href="#(ctx)/trade/solddetail/#(x.id)">详情</a>
	                  	
	                  	#if(x.status == 0) 
	                  		<button type="button" class="btn btn-info" id="closeBtn-#(x.id)">关闭</button>
	                  	#elseif(x.status == 2) 
	                  		<button type="button" class="btn btn-info" id="deliveryBtn-#(x.id)">发货</button>
	                  	#end
	                  	
	                  </td>
	                </tr>
                #end
              </tbody>
            </table>
          </div>
          
          <div class="table-responsive">
            <table class="table table-striped ">
            <caption><span class="text-warning"><h3>我买入的二手书</h3></span></caption>
              <thead>
                <tr>
                  <th>序号</th>
                  <th>图书</th>
                  <th>数量</th>
                  <th>原价</th>
                  <th>二手价</th>
                  <th>状态</th>
                  <th>操作</th>
                </tr>
              </thead>
              <tbody>
               #for(x : page2.getList())
	             	<tr>
	                  <td>#(for.index+1)</td>
	                  <td>
	                  	<a href="#(ctx)/book/detail/#(x.bookId)"><img src="#(uploadPah)#(x.book.bookImg)" alt="book image" width="70px"></a>
	              				<a href="#(ctx)/book/detail/#(x.bookId)">#(x.book.name)</a>
	                  </td>
	                 <td>#(x.num)</td>
	                  <td>#(x.total)</td>
	                  <td>#(x.soldTotal)</td>
	                  <td>#(statusMap[x.status+''])</td>
	                  <td>
	                  	<a type="button" class="btn btn-info" href="#(ctx)/trade/solddetail/#(x.id)">详情</a>
	                  	
	                  	#if(x.status == 3) 
	                  		<button type="button" class="btn btn-info" id="receivedBtn-#(x.id)">确认收货</button>
	                  	#elseif(x.status == 4 && x.commented == 0)
	                  		<a type="button" class="btn btn-info" href="#(ctx)/comments/#(x.id)">评价</a>
	                  	#end
	                  	
	                  </td>
	                </tr>
                #end
              </tbody>
            </table>
          </div>
#end
